package com.minelx.sqlstructures.common.parse;

import com.minelx.sequence.core.StringScanner;
import com.minelx.sequence.core.ReturnMatcher;

public class StringMatcher implements ReturnMatcher<String, StringScanner> {

	private static final char CAP = '"';

	@Override
	public boolean isMatch(StringScanner source) {
		return source.exists(String.valueOf(CAP));
	}

	@Override
	public String onMatched(StringScanner source) {
		return source.nextChar() + source.til(CAP) + CAP;
	}
}
